/*
 * Copyright (c)  2015~2020, xforceplus
 * All rights reserved.
 * Project:datacare-orm
 * Id: UpsertByTemplateAnnotationMapperInvokeImpl.java   2020-10-10 11-07-19
 * Author: Evan
 */
package cn.datacare.orm.mapper.impl;

import cn.datacare.orm.manager.impl.SQLManager;
import cn.datacare.orm.mapper.MapperInvoke;

import java.lang.reflect.Method;

/**
 * <p>
 * Title:
 * </p>
 * <p>
 * Description:
 * </p>
 * <p>
 * Copyright: 2015~2020
 * </p>
 * <p>
 * Company/Department: xforceplus
 * </p>
 *
 * @author Evan
 * <b>Creation Time:</b> 2020-10-10 11-07-19
 * @since V1.0
 */
public class UpsertByTemplateAnnotationMapperInvokeImpl implements MapperInvoke {
    @Override
    public Object call(SQLManager sm, Class entityClass, String sqlId, Method m, Object[] args) {

        int result = 0;
        if (args.length == 1) {
            result = sm.upsertByTemplate(args[0]);
        } else {
            throw new IllegalArgumentException("期望一个参数");
        }
        return result;
    }
}
